import { INestApplication } from '@nestjs/common';
// swagger文档
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';

export const initSwagger = (app: INestApplication) => {
  const swagger_config = new DocumentBuilder()
    .setTitle('歪fChat后台管理系统接口')
    .setDescription('API 接口说明文档')
    .setVersion('1.0')
    .addBearerAuth() // 如果你使用了 JWT 认证
    .build();
  const document = SwaggerModule.createDocument(app, swagger_config);
  SwaggerModule.setup('docs', app, document);
};
